A=[1 3 3  2  0; 0  0 5  -7  0; 0  0  0  5  0;  0  0  0  0 0];
A(2,:)=A(2,:)/A(2,3);
A(3,:)=A(3,:)/A(3,4);
A(1,:)=A(1,:)-A(1,3)/A(2,3)*A(2,:);
A(1,:)=A(1,:)-A(1,4)/A(3,4)*A(3,:);
A(2,:)=A(2,:)-A(2,4)/A(3,4)*A(3,:);
A